Method and system of receiving and translating CLI command data within a routing system

ABSTRACT

A method and system of receiving and translating data using an internetwork operating system (IOS) command line interface (CLI) parser subsystem of a routing system are shown. Input is received at the IOS CLI parser subsystem. The input is traversed. Where the input originates from outside of the router, the input is translated into a corresponding CLI statement. Where the input originates from within the router, the input is translated into a prescribed output format. The translated input is output.

BACKGROUND

1. Field of the Invention

The present invention relates to routing systems for computer networks,and more particularly to the transmission of instructions to and receiptof data from such routing systems.

2. Related Art

Access and configuration of a routing system involves sending commandsand instructions to and receiving information from the router itself.For routers using a version of the internetwork operating system (IOS),access is accomplished through the use of the IOS command line interface(CLI). IOS CLI is a comprehensive interface, which has expandedcontinuously as technology has improved over the past twenty years. Manycompanies now strive to support some variation on IOS CLI in theirrouting systems, and many consumers have invested heavily in IOS CLIsupport, developing complicated scripts to handle various configurationand access needs. As such, it is desirable for any improvements torouter access and control to acknowledge the existing investments ofconsumers.

IOS CLI is not the most program-friendly of interfaces, however. Twentyyears of consistency and backwards-compatibility, when coupled withconsistent improvements to the hardware and implementation of newfeatures, has created an extensive interface. While a human user of IOSCLI may be able to sort through the complicated input and output schemeto input information and extract important data, it has proven to be avery difficult and cumbersome task to automate.

A system and/or method that allows for an easy, more structured approachto accessing and configuring a router, while still making use of thesignificant advantages and experience associated with IOS CLI, would beadvantageous.

DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts a block diagram of an exemplary routing system, inaccordance with one embodiment of the present invention.

FIG. 2 is a flowchart of a method for receiving and translating datausing an internetwork operating system (IOS) command line interface(CLI) parser subsystem of a routing system, in accordance with oneembodiment of the present invention.

FIG. 3 is a flowchart of a method for receiving XML statements into anIOS CLI parser subsystem of a routing system and translating the XMLstatements into CLI commands, in accordance with one embodiment of thepresent invention.

FIG. 4 is a flowchart of a method for receiving CLI input into an IOSCLI parser subsystem of a routing system and translating the input intoXML statements, in accordance with one embodiment of the presentinvention.

DETAILED DESCRIPTION

A method of receiving and translating data using an internetworkoperating system (IOS) command line interface (CLI) parser subsystem ofa routing system, and a routing system incorporating that method, aredisclosed. Reference will now be made in detail to several embodimentsof the invention. While the invention will be described in conjunctionwith the alternative embodiment(s), it will be understood that they arenot intended to limit the invention to these embodiments. On thecontrary, the invention is intended to cover alternative, modifications,and equivalents, which may be included within the spirit and scope ofthe invention as defined by the appended claims.

Furthermore, in the following detailed description of the presentinvention, numerous specific details are set forth in order to provide athorough understanding of the present invention. However, it will berecognized by one skilled in the art that the present invention may bepracticed without these specific details or with equivalents thereof. Inother instances, well-known methods, procedures, components, andcircuits have not been described in detail as not to unnecessarilyobscure aspects of the present invention.

NOTATION AND NOMENCLATURE

Some portions of the detailed descriptions, which follow, are presentedin terms of procedures, steps, logic blocks, processing, and othersymbolic representations of operations on data bits that can beperformed on computer memory. These descriptions and representations arethe means used by those skilled in the data processing arts to mosteffectively convey the substance of their work to others skilled in theart. A procedure, computer-executed step, logic block, process, etc., ishere, and generally, conceived to be a self-consistent sequence of stepsor instructions leading to a desired result. The steps are thoserequiring physical manipulations of physical quantities. Usually, thoughnot necessarily, these quantities take the form of electrical ormagnetic signals capable of being stored, transferred, combined,compared, and otherwise manipulated in a computer system. It has provenconvenient at times, principally for reasons of common usage, to referto these signals as bits, values, elements, symbols, characters, terms,numbers, or the like.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. Unlessspecifically stated otherwise as apparent from the followingdiscussions, it is appreciated that throughout the present invention,discussions utilizing terms such as “accessing,” “writing,” “including,”“testing,” “using,” “traversing,” “associating,” “identifying” or thelike, refer to the action and processes of a computer system, or similarelectronic computing device, that manipulates and transforms datarepresented as physical (electronic) quantities within the computersystem's registers and memories into other data similarly represented asphysical quantities within the computer system memories or registers orother such information storage, transmission or display devices.

With reference now to FIG. 1, a block diagram of a routing system 100 isdepicted, in accordance with one embodiment of the invention. It isappreciated that the present invention is readily implemented in avariety of routing and/or switching configurations. Routing system 100includes IOS/CLI Parser 110, Memory 120, Command Module 130, RoutingFabric 140, input port 101, programming port 103, and several outputports 151. Command Module 130 is coupled to IOS/CLI Parser 110, Memory120, and Command Module 130. It is appreciated that the presentinvention is readily adaptable for utilization in systems of variousconfigurations, including systems with varying numbers of ports. In oneembodiment, input port 101 and programming port 103 might be combinedinto a single port. Moreover, differing types of input ports are used indifferent embodiments: direct physical terminal console ports are usedin one embodiment for interactive human users; another embodimentsupports the use of remote terminal protocols, such as SSH and telnet,for remote administration; a third embodiment allows for receipt ofinput as a batch process. No one type of input port is preferred for theutilization of this invention. One embodiment includes three outputports 151; another embodiment might use differing quantities. Similarly,another embodiment of a routing system may used separate memory for theIOC CLI parser and the processor.

The components of routing system 100 cooperatively operate to route orotherwise distribute signals received, pursuant to instructions receivedfrom a user. A user need not be an actual person; command statements maybe issued automatically by an outside program, which would be considereda “user” as well. It is appreciated that the term “command statements”is intended to be exemplary only; other types of statements, such asrequests for information, are also received by routing system 100 andare treated in similar fashion. In one embodiment, such commandstatements are received by routing system 100 through programming port103, and are passed to IOS/CLI Parser 110. In one embodiment of thepresent invention, these command statements may be formatted inaccordance with the CLI rules and behaviors expected by IOS/CLI Parser110, or in accordance with an XML schema of the CLI rules and behaviors.In another embodiment, these command statements can be formatted inaccordance with another set of rules and behaviors, or presented in alanguage other than XML or CLI. Once received by IOS/CLI Parser 110, thecommand statements are parsed according to instructions programmed intoIOS/CLI Parser 110. Alternatively, the command statements can be parsedin accordance with a model of the CLI command structure stored in Memory120. Non-CLI command statements must also be translated into CLIstatements that Command Module 130 can interpret.

Once the command statements have been parsed and translated, accordingto one embodiment, they are passed to Command Module 130. Command Module130 acts upon the received command statements in accordance withinstructions and data stored in Memory 120. When the command statementscall for a response from routing system 100, such as an acknowledgementof an altered setting or information regarding the performance ofrouting system 100, a response statement is returned to IOS/CLI Parser110.

In one embodiment, such a response statement would be received fromCommand Module 130 in CLI. IOS/CLI Parser 110 would translate the CLIresponse into an XML response in accordance with an XML schema of theCLI rules and behaviors. In other embodiments, a response statementcould be translated in accordance with a different set of rules orbehaviors, or outputted in languages other than XML.

Command Module 130 receives ingress or input information on throughinput port 101, and routes it to an appropriate output port 151. Theinformation flow through Command Module 130 is directed by CommandModule 130 based upon directions stored in Memory 120 or receivedthrough programming port 103, as detailed above. p103 also directsscheduling of information flows through routing system 100.

With reference now to FIG. 2, a flowchart 200 of a method for receivingand translating data using an IOS CLI parser subsystem of a routingsystem is depicted, in accordance with one embodiment of the invention.Although specific steps are disclosed in flowchart 200, such steps areexemplary. That is, embodiments of the present invention are well suitedto performing various other (additional) steps or variations of thesteps recited in flowchart 200. It is appreciated that the steps inflowchart 200 may be performed in an order different than presented, andthat not all of the steps in flowchart 200 may be performed.

In step 210 of flowchart 200, in one embodiment, input data is receivedat the IOS/CLI Parser 110 of a routing system 100. In one embodiment,this input may originate from outside the routing system 100, and bepassed to the IOS/CLI Parser 110 by way of programming port 103. Inanother embodiment, the input may originate from inside the routingsystem 100, and be passed to the IOS/CLI Parser 110 from Command Module130; in one embodiment, such input is a representation of the currentconfiguration settings of routing system 100. This input data can takethe form of CLI statements. Alternatively, the input can be formatted inaccordance with another language syntax; one embodiment calls for inputto be formatted in accordance with a specific XML schema of the CLIsyntax.

In step 220 of flowchart 200, in one embodiment, the input received instep 210 is traversed. During traversal, the source of the data can beascertained (e.g. whether the input originated from inside or outsiderouting system 100). This determination affects what operations areperformed on the input, as is explained in greater depth with referenceto FIGS. 3 and 4, below.

In step 230 of flowchart 200, in one embodiment, when the input receivedin step 210 originated from outside of routing system 100, the input istranslated into CLI statements. According to one embodiment, the inputwas originally formatted according to an XML schema of the CLI rules andbehaviors. In other embodiments, the input might be received in adifferent language and translated into CLI. Greater explanation of thistransformative behavior is explained with reference to FIG. 3, below.

In step 235 of flowchart 200, in one embodiment, when the input receivedin step 210 originated from inside or routing system 100, the input istranslated from CLI statements into a different format. According to oneembodiment, the CLI statements would be translated into correspondingXML statements, in accordance with an XML schema of the CLI rules andbehaviors. In other embodiments, the input would be translated intoother desirable output formats. Greater explanation of thistransformative behavior is explained with reference to FIG. 4, below.

In step 240 of flowchart 200, in one embodiment, the output of steps 230or 235 is passed along. In the case of step 230, the transformed inputis passed to Command Module 130 within routing system 100 for furtheraction, now that it is in CLI format. In the case of step 235, thetransformed input is passed to programming port 103, where it leavesrouting system 100.

With reference now to FIG. 3, a flowchart 300 of a method for receivingXML statements into an IOS CLI parser subsystem of a routing system andtranslating the XML statements into CLI commands, in accordance with oneembodiment of the present invention. Although specific steps aredisclosed in flowchart 300, such steps are exemplary. That is,embodiments of the present invention are well suited to performingvarious other (additional) steps or variations of the steps recited inflowchart 300. It is appreciated that the steps in flowchart 300 may beperformed in an order different than presented, and that not all of thesteps in flowchart 300 may be performed.

In step 310 of flowchart 300, in one embodiment, input data is receivedat the IOS/CLI Parser 110 of a routing system 100. In this embodiment,this input originates from outside the routing system 100, and is passedto the IOS/CLI Parser 110 by way of programming port 103. In thisembodiment, the input is formatted in accordance with a specific XMLschema of the CLI syntax. This schema minimizes the translation requiredfrom XML to CLI by requiring all existing CLI rules and behaviors to befollowed by the XML schema, e.g. the sequencing of commands within anXML request must follow CLI configuration rules. XML tags consist of CLIkeywords, with some additional tags for command parameters. An exampleof input formatted in accordance with one XML schema is presented inTable 1, below. TABLE 1 <add> <k_mpls_label> <k_range><range-min>10</range-min>   <range-max>300</range-max> <k_static>  <static-min>30</static-min>   <static-max>150</static-max> </k_static></k_range> </k_mpls_label> </add>

In step 320 of flowchart 300, in one embodiment, the input received instep 310 is traversed. In this embodiment, where the input is formattedin accordance with a specific XML schema of the CLI syntax, this stepincludes traversing the XML fragments associated with each XML Commandfrom top to bottom.

In step 330 of flowchart 300, in one embodiment, each XML tag has thefollowing rule applied to it. If an XML keyword tag contains anotherkeyword, it is translated into one or more CLI keywords. Multiple CLIkeywords may have been concatenated into a single XML tag delimited by acharacter, such as the underscore character “_”; in such cases, thekeywords are extracted from the tag and translated into multiple CLIkeywords.

In step 340 of flowchart 300, in one embodiment, each XML tag has thefollowing rule applied to it. If an XML keyword tag contains the booleanvalue “true”, it is translated into the associated CLI keyword.

In step 350 of flowchart 300, in one embodiment, each XML tag has thefollowing rule applied to it. If an XML keyword tag contains the booleanvalude “false”, it is skipped.

In step 360 of flowchart 300, in one embodiment, each XML tag has thefollowing rule applied to it. If an XML keyword tag is associated withan AND node, it is ignored and skipped; such tags are identifiablethrough naming conventions.

In step 370 of flowchart 300, in one embodiment, each XML tag has thefollowing rule applied to it. If an XML keyword tag is a parameter nodetag, the values inside the tag are extracted.

In step 380 of flowchart 300, in one embodiment, the translated CLIcommand statement is passed on. In one embodiment, the translated CLIcommand statement is passed to command module 130 to be acted upon inaccordance with the rules and behaviors associated with CLI. An exampleof a translated CLI command is presented below, in Table 2. This is theresult of translating the example input from Table 1, above, into CLI.TABLE 2 mpls label range 10 300 static 30 150

With reference now to FIG. 4, a flowchart 400 of a method for receivingCLI statements into an IOS CLI parser subsystem of a routing system andtranslating the CLI statements into XML statements, in accordance withone embodiment of the present invention. Although specific steps aredisclosed in flowchart 400, such steps are exemplary. That is,embodiments of the present invention are well suited to performingvarious other (additional) steps or variations of the steps recited inflowchart 400. It is appreciated that the steps in flowchart 400 may beperformed in an order different than presented, and that not all of thesteps in flowchart 400 may be performed.

In step 410 of flowchart 400, in one embodiment, input data is receivedat the IOS/CLI Parser 110 of a routing system 100. In this embodiment,this input originates from inside the routing system 100, and is passedto the IOS/CLI Parser 110 from command module 130. In this embodiment,the input is formatted in accordance with the CLI syntax, and is to betranslated into a specific XML schema of the CLI syntax. This schemaminimizes the translation required from CLI to XML by requiring allexisting CLI rules and behaviors to be followed by the XML schema, e.g.the sequencing of commands within an XML request must follow CLIconfiguration rules. XML tags consist of CLI keywords, with someadditional tags for command parameters.

In step 420 of flowchart 400, in one embodiment, the input received instep 410 is traversed. The CLI statements are parsed into tokens.

In step 430 of flowchart 400, in one embodiment, the IOS CLI parser alsoprepares an XML buffer in memory 120.

In step 440 of flowchart 400, in one embodiment, each CLI token has thefollowing rule applied to it. The CLI parse graph stored in memory 120is traversed, with respect to each token. In this embodiment, the parsegraph has been modified slightly from preceding implementations, to addadditional information to IOS parse node types that represent CLIkeywords and parameters. In the case of keyword nodes, the followinginformation is added: “parent_label,” which is a label given to ANDnodes; “is_boolean,” which is true if the keyword is a boolean value;and “has_more_tag,” which is true if the keyword is to be merged withthe next keyword. In the case of parameter nodes, the following isadded: “label,” the label given to parameter nodes; and “parent_label,”which is a label given to AND nodes.

In step 450 of flowchart 400, in one embodiment, each CLI token has thefollowing rule applied to it. The “Open XML Tag and Closed XMLtags+Value” rule, presented below in Table 3, assembles an XML statementfrom modified CLI tokens, placing the tokens in the XML buffer andadding characters as required to conform to the XML schema implemented.TABLE 3   Open XML Tag and Closed XML tags + Value Rule Open XML Tag isintroduced by:   Non-boolean value keyword parse node   Keyword orparameter node's parent_label For Parameter node:   Add “<” to XMLbuffer   Add parameter node's label string to XML buffer   Add “>” toXML buffer   Add parameter node's value to XML buffer   Add “</” to XMLbuffer   Add parameter node's label string to XML buffer   Add “>” toXML buffer For boolean keyword node (is_boolean is true)   Add “<” toXML buffer   Add keyword string to XML buffer   Add “>true</” to XMLbuffer   Add keyword string to XML buffer   Add “>” to XML buffer Fornon-boolean keyword node   if (last character in buffer is not “_”) {    Add “_” to XML buffer   } else (keyword's has_more_tag is false) {    Add “>” to XML buffer   }

In step 460 of flowchart 400, in one embodiment, each CLI token has thefollowing rule applied to it. The “Close XML tag” rule is used todetermine when to close an open XML tag to stop the nesting and moveback up the hierarchy. In this embodiment, the rule has two conditions,either of which may be satisfied: reaching the End of Line (EOL), or thetoken's “parent_label” is different from the preceding node's“parent_label” will close an open XML tag.

In step 470 of flowchart 400, in one embodiment, the translated XMLstatement will leave IOS CLI parser 110. In one embodiment, thetranslated XML statement will be returned to the user via programmingport 103.

The foregoing descriptions of specific embodiments of the presentinvention have been presented for purposes of illustration anddescription. They are not

The foregoing descriptions of specific embodiments of the presentinvention have been presented for purposes of illustration anddescription. They are not intended to be exhaustive or to limit theinvention to the precise forms disclosed, and obviously manymodifications and variations are possible in light of the aboveteaching. The embodiments were chosen and described in order to bestexplain the principles of the invention and its practical application,to thereby enable others skilled in the art to best utilize theinvention and various embodiments with various modifications as aresuited to the particular use contemplated. It is intended that the scopeof the invention be defined by the Claims appended hereto and theirequivalents.

1. A method of receiving and translating data using an internetworkoperating system (IOS) command line interface (CLI) parser subsystem ofa routing system, said method comprising: receiving input at said IOSCLI parser subsystem; traversing said input; where said input originatesoutside said router, translating said input into translated inputcomprising a corresponding CLI statement; where said input originatesinside said router, translating said input into translated inputcomprising a corresponding prescribed output format; and outputting saidtranslated input.
 2. The method of claim 1, wherein said input receivedcomprises XML data.
 3. The method of claim 2, wherein said XML datainput received comprises data formatted in accordance with an XML schemaof CLI rules and behaviors enforced by said IOS CLI parser subsystem. 4.The method of claim 3, wherein said input originates outside saidrouter, and wherein said translation of said input into a correspondingCLI statement comprises: parsing said input to identify an XML commandattribute; traversing said input after said XML command attribute toidentify any keywords and any parameters associated with said XMLCommand Attribute; translating said XML command attribute into anassociated CLI command; and translating said keywords and any parametersinto associated attributes of said CLI command.
 5. The method of claim1, wherein said corresponding prescribed output format comprises XMLdata.
 6. The method of claim 5, wherein said XML data comprises dataformatted in accordance with an XML data model of CLI rules andbehaviors enforced by said IOS CLI parser subsystem.
 7. The method ofclaim 6, wherein said input originates inside said router, and whereinsaid translation of said XML data output comprises: receiving a CLI datainput as said input; parsing said CLI data input to identify each tokenof said CLI data input; accessing a stored mapping of CLI to XML values;and translating each token of said CLI data input into a correspondingXML value, in accordance with said stored mapping.
 8. A computer-usablemedium having computer-readable program code embedded therein forcausing a computer system to execute a method of receiving andtranslating data using an internetwork operating system (IOS) commandline interface (CLI) parser subsystem of a router, said methodcomprising: receiving input at said IOS CLI parser subsystem; traversingsaid input; where said input originates outside said router, translatingsaid input into translated input comprising a corresponding CLIstatement; where said input originates inside said router, translatingsaid input into translated input comprising a corresponding prescribedoutput format; and outputting said translated input.
 9. Thecomputer-usable medium of claim 8, wherein said input received comprisesXML data.
 10. The computer-usable medium of claim 9, wherein said XMLdata input received comprises data formatted in accordance with an XMLschema of CLI rules and behaviors enforced by said IOS CLI parsersubsystem.
 11. The computer-usable medium of claim 10, wherein saidinput originates outside said router, and wherein said translation ofsaid input into a corresponding CLI statement comprises: parsing saidinput to identify an XML command attribute; traversing said input aftersaid XML command attribute to identify any keywords and any parametersassociated with said XML Command Attribute; translating said XML commandattribute into an associated CLI command; and translating said keywordsand any parameters into associated attributes of said CLI command. 12.The computer-usable medium of claim 8, wherein said correspondingprescribed output format comprises XML data.
 13. The computer-usablemedium of claim 12, wherein said XML data comprises data formatted inaccordance with an XML data model of CLI rules and behaviors enforced bysaid IOS CLI parser subsystem.
 14. The computer-usable medium of claim13, wherein said input originates inside said router, and wherein saidtranslation of said XML data output comprises: receiving a CLI datainput as said input; parsing said CLI data input to identify each tokenof said CLI data input; accessing a stored mapping of CLI to XML values;and translating each token of said CLI data input into a correspondingXML value, in accordance with said stored mapping.
 15. A system forcausing a computer system to receive and translate data using aninternetwork operating system (IOS) command line interface (CLI) parsersubsystem of a router, said system comprising: means for receiving inputat said IOS CLI parser subsystem; means for traversing said input; wheresaid input originates outside said router, means for translating saidinput into translated input comprising a corresponding CLI statement;where said input originates inside said router, means for translatingsaid input into translated input comprising a corresponding prescribedoutput format; and means for outputting said translated input.
 16. Thesystem of claim 15, wherein said means for receiving input comprisesmeans for receiving XML data as input.
 17. The system of claim 16,wherein said XML data input received comprises data formatted inaccordance with an XML schema of CLI rules and behaviors enforced bysaid IOS CLI parser subsystem.
 18. The system of claim 17, wherein saidinput originates outside said router, and wherein said means fortranslating of said input into a corresponding CLI statement comprises:means for parsing said input to identify an XML command attribute; meansfor traversing said input after said XML command attribute to identifyany keywords and any parameters associated with said XML CommandAttribute; means for translating said XML command attribute into anassociated CLI command; and means for translating said keywords and anyparameters into associated attributes of said CLI command.
 19. Thesystem of claim 15, wherein said corresponding prescribed output formatcomprises XML data.
 20. The system of claim 19, wherein said XML datacomprises data formatted in accordance with an XML data model of CLIrules and behaviors enforced by said IOS CLI parser subsystem.
 21. Thesystem of claim 20, wherein said input originates inside said router,and wherein said means for translating of said XML data outputcomprises: receiving a CLI data input as said input; parsing said CLIdata input to identify each token of said CLI data input; accessing astored mapping of CLI to XML values; and translating each token of saidCLI data input into a corresponding XML value, in accordance with saidstored mapping.